<template>
  <a-modal
    title="查看"
    :width="640"
    :visible="visible"
    @cancel="handleCancel"
  >
    <div>
      <a-card :title="'应用名称：' + itemInfo.name" style="min-width: 300px" class="card_txt">
        <a-row >
          <a-col :span="12">
            <p v-if="itemInfo.version">版本号：{{ itemInfo.version }}</p>
            <p v-if="itemInfo.developerName">开发商：{{ itemInfo.developerName }}</p>
            <p v-if="itemInfo.introduction">应用描述：{{ itemInfo.introduction }}</p>
            <div v-if="itemInfo.copyrightPic">
              <p>版权证明：<span @click="downClick(itemInfo.copyrightPic)">下载</span></p>
              <img style="max-width:150px;max-height:150px" :src="itemInfo.copyrightPic" alt="">
            </div>
            <div v-if="itemInfo.qualificationDoc">
              <p>资质许可证明：<span @click="downClick(itemInfo.qualificationDoc)">下载</span></p>
              <img style="max-width:150px;max-height:150px" :src="itemInfo.qualificationDoc" alt="">
            </div>
            <div v-if="itemInfo.downloadUrl">
              <p>APK安装包：<span @click="downClick(itemInfo.downloadUrl)">下载</span></p>
            </div>
          </a-col>
          <a-col :span="12" style="text-align:center">
            <img style="max-width:150px;max-height:150px" :src="itemInfo.iconUrl" alt="">
          </a-col>
        </a-row>
        <div v-if="itemInfo.appPics && itemInfo.appPics.length !== 0" class="appPics">
          <p>应用截图：</p>
          <div v-for="(img, index) in itemInfo.appPics" :key="index">
            <img style="max-width:150px;max-height:150px" :src="img.url" alt="">
          </div>
          <span class="clear"></span>
        </div>
      </a-card>
    </div>
    <template slot="footer">
    </template>
  </a-modal>
</template>

<script>

export default {
  name: 'LookModel',
  components: {
  },
  data () {
    return {
      itemInfo: {},
      visible: false
    }
  },
  methods: {
    look (record) {
      this.itemInfo = record
      this.visible = true
    },
    handleCancel () {
      this.visible = false
    },
    downClick (url) {
      if (url) {
        window.location.href = url
      }
    }
  }
}
</script>
<style lang="less" scoped>
.card_txt /deep/ .ant-card-body{
    img{
        width: 100%;
    }
    .ant-col-12{
        div{
            margin-bottom: 20px;
            p{
                margin-bottom: 5px;
            }
            span{
                color: #1890ff;
                cursor: pointer;
            }
        }
    }
    .appPics{
        div{
            float: left;
            width: 25%;
            padding: 10px;
            img{
                width: 100%;
            }
        }
    }
}
</style>
